package com.mathassistant.client.event.theory;

import com.google.gwt.event.shared.GwtEvent;
import com.mathassistant.shared.TheoryDTO;
import com.mathassistant.shared.TopicDTO;

public class TheoryEditEvent extends GwtEvent<TheoryEditEventHandler>{

	public static final Type<TheoryEditEventHandler> TYPE = new Type<TheoryEditEventHandler>();
	private TheoryDTO theory;
	private TopicDTO topic;
	private int indexBeginList;
	
	public TheoryEditEvent(TheoryDTO theory, TopicDTO topic, int indexBeginList){
		this.theory = theory;
		this.topic = topic;
		this.indexBeginList = indexBeginList;
	}
	
	public TheoryDTO getTheory() {
		return theory;
	}
	
	public TopicDTO getTopic() {
		return topic;
	}

	public int getIndexBeginList() {
		return indexBeginList;
	}

	@Override
	public Type<TheoryEditEventHandler> getAssociatedType() {
		// TODO Auto-generated method stub
		return TYPE;
	}

	@Override
	protected void dispatch(TheoryEditEventHandler handler) {
		// TODO Auto-generated method stub
		handler.onEditTheory(this);
	}

}
